#include "PeripheralModule.h"

static const int PERIPHERAL_MODULE_INVALID = -1;

VTABLE(PeripheralModule, Object)
    VMETHOD(Object, dtor) = (void (*)(Object *))&_PeripheralModule_dtor;
    VMETHOD(PeripheralModule, dtor) =
            (void (*)(PeripheralModule *))&_PeripheralModule_dtor;
VTABLE_END

void _PeripheralModule_ctor(PeripheralModule *obj) {
    _Object_ctor(&obj->super);
    VHOOK(PeripheralModule);
    obj->_module = PERIPHERAL_MODULE_INVALID;
}

void _PeripheralModule_dtor(PeripheralModule *obj) {
    obj->_module = PERIPHERAL_MODULE_INVALID;
    _Object_dtor(&obj->super);
}

int _PeripheralModule_isValid(PeripheralModule *obj) {
    return (obj->_module != PERIPHERAL_MODULE_INVALID);
}
